<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="/js/jquery-3.6.0.min.js"></script>
    <link href="../css/company.css" type="text/css" rel="stylesheet">
</head>
<body>
<div th:include="common/inc"></div>
<form class="elegant-aero">
    <h1>添加职位
        <!--        <span>请填写全部信息</span>-->
    </h1>
    <label>
        <span>职位名称 :</span>
        <input id="positionName" type="text" name="positionName" placeholder="职位名称" />
    </label>
    <label>
        <span>职位职能 :</span>
        <input id="functions" type="text" name="functions" placeholder="职位职能" />
    </label>
    <label>
        <span>职位信息 :</span>
        <textarea id="description" name="description" placeholder="职位信息"></textarea>
    </label>
    <label>
        <span>学历要求 :</span>
        <select name="degree">
            <option value="无">请选择</option>
            <option th:each="t:${degree}" th:value="${t.dataName}" th:text="${t.dataName}"></option>
        </select>
    </label>
    <label>
        <span>工作经验 :</span>
        <select name="experience">
            <option value="无">请选择</option>
            <option th:each="t:${experience}" th:value="${t.dataName}" th:text="${t.dataName}"></option>
        </select>
    </label>
    <label>
        <span>薪资范围 :</span>
        <select name="salary">
            <option value="无">请选择</option>
            <option th:each="t:${salary}" th:value="${t.dataName}" th:text="${t.dataName}"></option>
        </select>
    </label>
    <label>
        <span>&nbsp;</span>
        <input type="button" class="button" id="add" value="新增" onclick="addPosition()">
    </label>
</form>
<!--<form class="form-inline">-->
<!--    <table border="1">-->
<!--        <tr>-->
<!--            <td>职位信息</td>-->
<!--            <td>-->
<!--                <input type="text" name="description" class="form-control">-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td>职位名称</td>-->
<!--            <td>-->
<!--                <input type="text" name="positionName" class="form-control">-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td>职位职能</td>-->
<!--            <td>-->
<!--                <input type="text" name="functions" class="form-control">-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td>学历要求</td>-->
<!--            <td>-->
<!--                <select class="form-control info-select" name="degree" >-->
<!--                    <option value="无">请选择</option>-->
<!--                    <option th:each="t:${degree}" th:value="${t.dataName}" th:text="${t.dataName}"></option>-->
<!--                </select>-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td>工作经验</td>-->
<!--            <td>-->
<!--                <select class="form-control info-select" name="experience" >-->
<!--                    <option value="无">请选择</option>-->
<!--                    <option th:each="t:${experience}" th:value="${t.dataName}" th:text="${t.dataName}"></option>-->
<!--                </select>-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td>薪资范围</td>-->
<!--            <td>-->
<!--                <select class="form-control info-select" name="salary" >-->
<!--                    <option value="无">请选择</option>-->
<!--                    <option th:each="t:${salary}" th:value="${t.dataName}" th:text="${t.dataName}"></option>-->
<!--                </select>-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td colspan="2">-->
<!--&lt;!&ndash;                <input type="button" value="新增" onclick="addPosition()" class="btn-success">&ndash;&gt;-->
<!--                <div id="login_click">-->
<!--                    <a id="btlogin" onclick="addPosition()">新增</a>-->
<!--                </div>-->
<!--            </td>-->
<!--        </tr>-->
<!--    </table>-->
<!--</form>-->
</body>

<script>

    function addPosition(){
        $.ajax({
            url:"/position/addPosition",
            type:"post",
            data:$("form").serialize(),
            success:function (){
                alert("新增成功");
                location.href="/position/position";//跳转
            },error:function () {
                alert("新增失败");
            }
        })
    }

</script>


</html>